//
//  SampuxAddEquipMentFaithViewController.m
//  Sampux
//
//  Created by rzm on 16/7/11.
//  Copyright © 2016年 rzm. All rights reserved.
//

#import "SampuxAddEquipMentFaithVC.h"
#import "SampuxAddEquipmentFaithView.h"
#import "SampuxAddEquipmentViewController.h"
#import "SampuxDocumentViewController.h"

@interface SampuxAddEquipMentFaithVC ()

@end

@implementation SampuxAddEquipMentFaithVC

- (void)viewDidLoad {
    [super viewDidLoad];
//    [self createBackBarButtonItem];
    [self.navigationItem setHidesBackButton:YES];
    SampuxAddEquipmentFaithView *failView = [[SampuxAddEquipmentFaithView alloc]initWithFrame:CGRectMake(0, 0, self.view.width, self.view.height)];
    [self.view addSubview:failView];
    failView.retryBlock = ^(){
        UIViewController *aViewController = [self.navigationController.viewControllers objectAtIndex:1];
        if ([aViewController isKindOfClass:[SampuxAddEquipmentViewController class]]) {
                   SampuxAddEquipmentViewController *addVC =  (SampuxAddEquipmentViewController *)aViewController;
            addVC.account = self.account;
        }
        [self.navigationController popToViewController:aViewController animated:YES];
    };
    failView.helpBlock = ^()
    {
        SampuxDocumentViewController *documentVC = [[SampuxDocumentViewController alloc]init];
        [self.navigationController pushViewController:documentVC animated:YES];
    };
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:YES];
    SampuxCustomNavController *nav = (SampuxCustomNavController *)self.navigationController;
    nav.titleStr = @"";
}

@end
